package com.kun.spring.bean;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.util.SocketUtils;

/**
 * @Classname Cat
 * @Created by FangKun
 * @Date 2022/11/14 0014 下午 21:53
 */
//@Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@Component
public class Cat implements InitializingBean {

	public Cat(){
		System.out.println("cat....被创建了....");
	}

	private String name;

	@Value("${JAVA_HOME}")
	public void setName(String name) {
		System.out.println("cat 正在...setName...");
	}

	public String getName() {
		return name;
	}

	@Override
	public String toString() {
		return "Cat{" +
				"name='" + name + '\'' +
				'}';
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("Cat..InitializingBean...afterPropertiesSet.....  ");
	}
}
